import express from 'express';
import {
	executeQuery,
	pool
} from '../../mysql/dbconfig.js';

export const tools_route = express.Router();

export const prefix = '/tools';

tools_route.get('/list', async (req, res) => {
	try {
		const sql = `SELECT * FROM list;`; //sql语句 搜索test表所有数据
		const result = await executeQuery(sql); //执行sql语句
		res.send({
			code: 200,
			message: 'ok',
			data: result
		});
	} catch (error) {
		console.error('Error executing query:', error);
		res.status(500).send('Internal Server Error');
	}
});
